package com.gusti.common.controller.login;

import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/logout.do")
public class LogoutController {

	@RequestMapping(method = RequestMethod.POST)
	public ModelAndView doLogout( Map<String, Object> model, HttpSession session ) {
		
		session.removeAttribute( "user" );
		session.invalidate();
		model.put( "identifier", "/pelotero/" );
		return new ModelAndView( "identifier", "model", model );
	}

}
